﻿@model CTM.Web.Models.View.Account.AssociateViewModel
@using CTM.Web.Utils

<header class="navbar navbar-default navbar-static-top">
    <div class="container-fluid" style="background-color: white;">
        <div class="navbar-header">
            <button data-target="#rbvh-navbar" data-toggle="collapse" class="navbar-toggle" type="button">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a style="margin-top: -6px;" href="https://connect.bosch.com/profiles/html/profileView.do?userid=@Model.Id" class="navbar-brand">
                @{
                    var userPhoto = string.Empty;
                    if (Model != null && Request.IsAuthenticated)
                    {
                        userPhoto = Model.Avatar;
                        // The photograph itself should be taken from a standard database
                        // (Bosch Connect or Office 2013/Microsoft NGW framework).
                        //userPhoto = string.Format("/profiles/photo.do?key={0}", Model.Id);
                    }
                }
                <img src="@userPhoto" class="hidden-xs img-thumbnail user-avatar" style="width: 96px; height: 96px;" />
                <img src="@userPhoto" class="hidden-sm hidden-md hidden-lg user-avatar" />
            </a>
        </div>

        <div class="collapse navbar-collapse" id="rbvh-search-header">
            <ul class="nav navbar-nav">
                <li class="hidden-sm hidden-md">
                    @{
                        var userDisplayName = string.Empty;
                        if (Request.IsAuthenticated)
                        {
                            userDisplayName = Model.DisplayName;
                        }
                    }
                    <div style="margin-top: 20px;">@userDisplayName</div>
                </li>
                <li class="color-green">
                    <div class="form-inline" style="padding: 15px 15px 0;">
                        <div class="form-group">
                            <div class="input-group input-group-sm" id="associate-search-box">
                                <input type="text" class="form-control typeahead" placeholder="Search for associates..." style="width:300px;">
                                <span class="input-group-btn">
                                    <button class="btn btn-sm btn-default" type="button">
                                        <span class="glyphicon glyphicon-search"></span>
                                    </button>
                                </span>
                            </div>
                        </div>
                    </div>
                </li>
                <li class="text-right bold hidden-sm">
                    <h4 style="padding: 10px 0;">Conversations that Matter</h4>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right hidden-sm">
                <li class="bold">
                    <a class="navbar-brand text-center" href="#" style="width: 165px; padding-top: 5px;">
                        <img src="@Url.Content("~/Content/Images/bosch_logo.png")" alt="" />
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="container-fluid">
        <div style="visibility: hidden;" class="navbar-header hidden-xs hidden-sm">
            <a href="/" class="navbar-brand"><img></a>
        </div>
        <div class="navbar-collapse collapse" id="rbvh-navbar">
            <ul class="nav navbar-nav">
                @if (ViewBag.showHomeMenu == true)
                {
                    <li role="presentation" class="@Html.IsActive("Index", "Home")">
                        <a href="@Url.Action("Index", "Home", new { id = GlobalVariables.SelectedUser.Id })">
                            <span class="hidden-sm">Home</span>
                            <span class="hidden-xs hidden-md hidden-lg">
                                <span class="glyphicon glyphicon-home"></span>
                            </span>
                        </a>
                    </li>
                }
                @if (ViewBag.showMyNoteMenu == true)
                {
                    <li role="presentation" class="@Html.IsActive("MyNote", "Note")">
                        <a href="@Url.Action("MyNote", "Note", new { id = GlobalVariables.SelectedUser.Id })">
                            My Notes
                        </a>
                    </li>
                }
                @if (ViewBag.showManagerConversationMenu == true)
                {
                    <li role="presentation" class="@Html.IsActive("Index", "Conversation")">
                        <a href="@Url.Action("Index", "Conversation", new { id = GlobalVariables.SelectedUser.Id })">
                            <span class="hidden-sm">Manager Conversations</span>
                            <span class="hidden-xs hidden-md hidden-lg">Mgr Convers.</span>
                        </a>
                    </li>
                }
                <li role="presentation" class="@Html.IsActive("Index", "Feedback")">
                    <a href="@Url.Action("Index", "Feedback", new { id = GlobalVariables.SelectedUser.Id })">
                        Feedback
                    </a>
                </li>
                @if (ViewBag.showManagerNoteMenu == true)
                {
                    <li role="presentation" class="@Html.IsActive("ManagerNote", "Note")">
                        <a href="@Url.Action("ManagerNote", "Note", new { id = GlobalVariables.SelectedUser.Id })">
                            <span class="hidden-sm">Manager Notes</span>
                            <span class="hidden-xs hidden-md hidden-lg">Mgr Notes</span>
                        </a>
                    </li>
                }
                @if (ViewBag.showManagerReportMenu == true)
                {
                    <li role="presentation" class="@Html.IsActive("Index", "Report")">
                        <a href="@Url.Action("Index", "Report", new { id = GlobalVariables.SelectedUser.Id })">
                            <span class="hidden-sm">Manager Report</span>
                            <span class="hidden-xs hidden-md hidden-lg">Mgr Report</span>
                        </a>
                    </li>
                }
                @if (ViewBag.showRoleMenu == true)
                {
                    <li role="presentation" class="@Html.IsActive("Index", "Role")">
                        <a href="@Url.Action("Index", "Role")">
                            <span class="hidden-sm">Role</span>
                            <span class="hidden-xs hidden-md hidden-lg">Role</span>
                        </a>
                    </li>
                }
            </ul>
            <ul class="nav navbar-nav navbar-right">

                @if (Request.IsAuthenticated)
                {
                    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-left", style = "padding: 8px 15px 0 0;" }))
                    {
                        @Html.AntiForgeryToken()

                        <li class="dropdown">
                            <a href="@Url.Action("Index", "Home", new { id = GlobalVariables.CurrentUser.Id })" class="dropdown-toggle"
                               data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true" style="background-color: inherit;">
                                @if (Model.TotalNotifications > 0)
                                {
                                    <span id="notification-popup" class="badge bg-red" style="right: -55px; top: -15px; position: relative;">@Model.TotalNotifications</span>
                                }
                                <img style="width: 40px; height: 40px; padding: 1px;" class="hidden-xs img-thumbnail user-avatar" src="@GlobalVariables.CurrentUser.Avatar" />
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="@Url.Action("Index", "Home", new { id = GlobalVariables.CurrentUser.Id })">
                                        @GlobalVariables.CurrentUser.DisplayName
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="@Url.Action("About", "Home", new { id = GlobalVariables.CurrentUser.Id })">
                                        Help
                                    </a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
                                </li>
                            </ul>
                        </li>
                    }
                }
            </ul>
        </div>
    </div>
</header>